package com.lsf.dunlian.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.lsf.dunlian.R;
import com.lsf.dunlian.activity.AttendanceActivity;
import com.lsf.dunlian.activity.MemberActivity;
import com.lsf.dunlian.activity.MemberListActivity;
import com.lsf.dunlian.activity.NoticeActivity;
import com.lsf.dunlian.activity.ReimbursementActivity;
import com.lsf.dunlian.activity.ReimbursementRecordActivity;
import com.lsf.dunlian.callback.GroupChatCallBack;
import com.lsf.dunlian.entity.GroupChatMessageVo;
import com.lsf.dunlian.netty.SimpleClientHandler;

public class WorkPageFragment extends Fragment implements GroupChatCallBack {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_work, null);
        init(view);
        SimpleClientHandler.register(this);
        return view;
    }

    private void init(View view) {
        RelativeLayout relativeLayout = view.findViewById(R.id.kaoqin);
        RelativeLayout baoxiao = view.findViewById(R.id.baoxiao);
        RelativeLayout baoxiaojilu = view.findViewById(R.id.baoxiaojilu);
        RelativeLayout kehuList = view.findViewById(R.id.kehuList);
        RelativeLayout kehu = view.findViewById(R.id.kehu);
        RelativeLayout gongao = view.findViewById(R.id.gongao);
        relativeLayout.setOnClickListener(v -> startActivity(new Intent(getActivity(), AttendanceActivity.class)));
        baoxiao.setOnClickListener(v -> startActivity(new Intent(getActivity(), ReimbursementActivity.class)));
        baoxiaojilu.setOnClickListener(v -> startActivity(new Intent(getActivity(), ReimbursementRecordActivity.class)));
        kehu.setOnClickListener(v -> startActivity(new Intent(getActivity(), MemberActivity.class)));
        gongao.setOnClickListener(v -> startActivity(new Intent(getActivity(), NoticeActivity.class)));
        kehuList.setOnClickListener(v -> startActivity(new Intent(getActivity(), MemberListActivity.class)));
    }

    private void getUserList(){

    }

    @Override
    public void message(GroupChatMessageVo vo) {

    }
}
